<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://beta.mamsy.ru/" />
<title>тело_заказа</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">тело_заказа</td></tr>
</thead><tbody>
<tr>
	<td>setSpeed</td>
	<td>0</td>
	<td></td>
</tr>
<tr>
	<td>open</td>
	<td>/</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>if (selenium.isElementPresent(&quot;id=input-login_mail&quot;)==true){nextMove=&quot;login&quot;} else {nextMove=&quot;exit&quot;}</td>
	<td>loginPage</td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>${loginPage}</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>exit</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=logout</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>login</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=input-login_mail</td>
	<td>39@mailforspam.com</td>
</tr>
<tr>
	<td>click</td>
	<td>css=input.button__button</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=loginMessages</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=#login-pass_view &gt; label.content__form__text__bg</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=input-login_pass</td>
	<td>111111</td>
</tr>
<tr>
	<td>click</td>
	<td>css=input.button__button</td>
	<td></td>
</tr>
<tr>
	<td>store</td>
	<td>1</td>
	<td>p</td>
</tr>
<tr>
	<td>store</td>
	<td>3</td>
	<td>i</td>
</tr>
<tr>
	<td>label</td>
	<td>startscript</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>logo</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=all-sale__box${i}</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=content</td>
	<td></td>
</tr>
<tr>
	<td>echo</td>
	<td>${p}</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=product_listing</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//div[@id='product_listing']/div[${p}]/p/a/img</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>if (selenium.isElementPresent(&quot;id=img_submit&quot;)==true){nextMove=&quot;buy&quot;} else {nextMove=&quot;search_buy&quot;}</td>
	<td>openPage</td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>${openPage}</td>
	<td></td>
</tr>
<!--Кнопка Купить есть, идет покупка товара, до следующей метки-->
<tr>
	<td>label</td>
	<td>buy</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=img[alt=&quot;Оформить заказ&quot;]</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>xpath=(//a[contains(text(),'История заказов')])[2]</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=img[alt=&quot;Оформить заказ&quot;]</td>
	<td></td>
</tr>
<!--Заполняем поля-->
<tr>
	<td>waitForElementPresent</td>
	<td>css=i.payment-box__i-cash</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=comments</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=customers_firstname</td>
	<td>Александр</td>
</tr>
<tr>
	<td>type</td>
	<td>id=customers_lastname</td>
	<td>&lt;sсrірt&gt;alert('xss');&lt;/sсrірt&gt;</td>
</tr>
<tr>
	<td>type</td>
	<td>id=customers_telephone</td>
	<td>&lt;sсrірt&gt;alert('xss');&lt;/sсrірt&gt;</td>
</tr>
<tr>
	<td>type</td>
	<td>id=comments</td>
	<td>&lt;sсrірt&gt;alert('xss');&lt;/sсrірt&gt;</td>
</tr>
<!--Кликаем пораньше, чтобы увидеть ошибку-->
<tr>
	<td>clickAndWait</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=p.error</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=entry_city</td>
	<td>Москва</td>
</tr>
<tr>
	<td>click</td>
	<td>id=payment-box_cash</td>
	<td></td>
</tr>
<!--Ждем подгрузки бокса "Курьер" и  поля ввода адреса-->
<tr>
	<td>waitForTable</td>
	<td>//div[@id='content']/form/div[2]/table[2].0.0</td>
	<td>Курьером</td>
</tr>
<tr>
	<td>waitForTable</td>
	<td>css=#address_container &gt; table.checkout__table-form.0.2</td>
	<td></td>
</tr>
<!--Сп. оплаты - наличные-->
<tr>
	<td>type</td>
	<td>id=entry_street_address</td>
	<td>&lt;sсrірt&gt;alert('xss');&lt;/sсrірt&gt;</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=img_submit</td>
	<td></td>
</tr>
<tr>
	<td>waitForPageToLoad</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>End</td>
	<td></td>
</tr>
<!--Ищем кнопку Купить-->
<tr>
	<td>label</td>
	<td>search_buy</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>${p}+1</td>
	<td>p</td>
</tr>
<tr>
	<td>echo</td>
	<td>${p}</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>startscript</td>
	<td></td>
</tr>
<!--Конец заказа-->
<tr>
	<td>label</td>
	<td>End</td>
	<td></td>
</tr>
<!--Идем в админку-->
<tr>
	<td>open</td>
	<td>/call</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=order-id</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=a.date-link</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=orders</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=#date-link &gt; strong</td>
	<td></td>
</tr>
<!--Тело заказа-->
<tr>
	<td>click</td>
	<td>//table[@id='orders']/tbody/tr[1]/td[3]/nobr/a</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=tabs-1</td>
	<td></td>
</tr>
<!--Редактировать пользователя-->
<tr>
	<td>click</td>
	<td>link=Редактировать пользователя</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>name=customers_postcode</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>name=customers_postcode</td>
	<td>тест</td>
</tr>
<tr>
	<td>click</td>
	<td>css=#customer-edit &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<!--Закладки-->
<tr>
	<td>click</td>
	<td>link=Клиент</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=#customer_status &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>link=История заказов</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=div.div-orders-history</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>link=Способ доставки</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=delivery_type_container</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>link=Клиент</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=#customer_status &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=customer-comment</td>
	<td>тест</td>
</tr>
<tr>
	<td>click</td>
	<td>css=#customer_status &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>link=Способ доставки</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=delivery_type_container</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>//div[4]/form/button</td>
	<td></td>
</tr>
<!--Пересчитать заказ-->
<tr>
	<td>click</td>
	<td>link=Пересчитать заказ</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=#order-edit &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=#order-edit &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<!--Добавить 3 позиции-->
<tr>
	<td>store</td>
	<td>0</td>
	<td>i</td>
</tr>
<tr>
	<td>label</td>
	<td>start</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>link=Добавить товар</td>
	<td></td>
</tr>
<tr>
	<td>waitForTable</td>
	<td>css=#add-form &gt; form &gt; table.order-detail.0.0</td>
	<td>Название товара</td>
</tr>
<tr>
	<td>type</td>
	<td>name=search_product</td>
	<td>tt</td>
</tr>
<tr>
	<td>click</td>
	<td>css=#add-form &gt; form &gt; button.kd-button.kd-button-submit</td>
	<td>Найти товар</td>
</tr>
<tr>
	<td>waitForTable</td>
	<td>css=#search_res &gt; table.order-detail.0.1</td>
	<td>(распродажа) наименование</td>
</tr>
<tr>
	<td>click</td>
	<td>css=input[type=&quot;submit&quot;]</td>
	<td>кликаем на плюс</td>
</tr>
<!--Добавляем ещё одну позицию-->
<tr>
	<td>storeEval</td>
	<td>${i}+1</td>
	<td>i</td>
</tr>
<tr>
	<td>store</td>
	<td>3</td>
	<td>Stepcount</td>
</tr>
<tr>
	<td>echo</td>
	<td>${i}</td>
	<td></td>
</tr>
<tr>
	<td>while</td>
	<td>storedVars['i'] &lt;= storedVars['Stepcount']</td>
	<td></td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>start</td>
	<td></td>
</tr>
<tr>
	<td>endWhile</td>
	<td></td>
	<td></td>
</tr>
<!--Увеличиваем кол-во товара плюсом-->
<tr>
	<td>click</td>
	<td>css=div &gt; div &gt; img</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=div &gt; div &gt; img</td>
	<td>+</td>
</tr>
<!--Уменьшаем-->
<!--Удаляем позицию крестом-->
<!--Меняем статус-->
<tr>
	<td>select</td>
	<td>id=orderStatus</td>
	<td>label=Готов к отправке</td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=deliveryDate</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>id=deliveryDate</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>//div[@id='ui-datepicker-div']/table/thead/tr/th[4]</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>id=orderStatus</td>
	<td></td>
</tr>
<tr>
	<td>select</td>
	<td>id=orderStatus</td>
	<td>label=Доставлен</td>
</tr>
<tr>
	<td>click</td>
	<td>css=#changeStatusForm &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>select</td>
	<td>id=orderStatus</td>
	<td>label=Возврат</td>
</tr>
<tr>
	<td>click</td>
	<td>css=#changeStatusForm &gt; button.kd-button.kd-button-submit</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>xpath=(//button[@type='button'])[2]</td>
	<td>Кнопка не можем дозвониться</td>
</tr>
</tbody></table>
</body>
</html>
